package com.hanamaki.dataStructDemo;

import java.util.ArrayList;
import java.util.List;

public class ArrayListVo {

    public static void main(String[] args) {

        Student<Object> xh = new Student<>();
        xh.setName("小红");
        xh.setAge("23");
        List<String> hobbies = new ArrayList<>();
        hobbies.add("sleep");
        hobbies.add("game");
        hobbies.add("code");
        xh.setHobbies(hobbies);
        xh.setScore("56");
        xh.setSex("女");

        Student<Object> xb = new Student<>();
        xb.setName("小白");
        xb.setAge("43");
        List<String> h = new ArrayList<>();
        h.add("eat");
        h.add("drink");
        h.add("code");
        xb.setHobbies(h);
        xb.setScore("99");
        xb.setSex("男");

        List<Student> list = new ArrayList<>();
        list.add(xh);
        list.add(xb);

        System.out.println(list);

        // 遍历集合
        for (Student student : list) {
            System.out.println(student.toString());
        }
    }

}
